using System.Web.UI;
using System.Web.UI.WebControls;

namespace SouthernLand.Common.Untilities
{
    [ParseChildren(true)]
    public class RegEvalid : RegularExpressionValidator
    {
        public string ResourceName { get; set; }

        protected override void CreateChildControls()
        {
            EnableViewState = false;
            Display = ValidatorDisplay.None;

            if (ResourceName != "")
            {
                ErrorMessage = ResourceManager.GetString(ResourceName);
                SetFocusOnError = true;
            }
            else
            {
                Visible = false;
            }
        }
    }
}